Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RequestContext::after_response(budget, task)on Cloudflare Workers so background work starts after terminal response egress without delaying delivery.waitUntilpromises, give each task a fresh outbound callback scope, and cancel pending work atmin(budget, 30 seconds)after release.after-response-tasksasBoundedCooperativefor Cloudflare and document Workers lifetime limits, registration closure, and lack of persistence or retries.Stacked on #509 (
feature/476-after-response-tasks, basec3ba7e56), which supplies the portable task API and response-egress foundation. This PR targets that branch; its changes are the Cloudflare implementation of #478.Changes
edgezero-adapter-cloudflare/src/after_response.rs,src/lib.rsedgezero-adapter-cloudflare/src/request.rs,src/response.rsedgezero-adapter-cloudflare/src/cli.rsBoundedCooperativesupport and update the capability test.edgezero-adapter-cloudflare/tests/contract.rsand colocated testsCHANGELOG.mdscripts/check_outbound_docs_contract.mjsCloses
Closes #478
Test plan
Local checks used Rust 1.98.1 and Node.js 24.20.0. GitHub CI remains pending.
cargo test --workspace --all-targetscargo clippy --workspace --all-targets --all-features -- -D warningscargo fmt --all -- --checkcargo check --workspace --all-targets --features "fastly cloudflare spin"wasm32-wasip1(Fastly) /wasm32-wasip2(Spin) /wasm32-unknown-unknown(Cloudflare) — Cloudflare Worker built and Spin target checked; Fastly target build not rerun for this Cloudflare change.examples/app-demoworkspace:cd examples/app-demo && cargo test --workspace --all-targetscd docs && npm run lint && npm run format && npm run buildedgezero serve --adapter axum— runtime verification used Cloudflare below.cloudflareandcloudflare,test-utils; Cloudflare WASM unit/contract suites and browser ingress suite; outbound documentation contract check.1, expected0).run_appconsumer under local Wrangler 4.83/workerd: response-first return about 3 ms versus an inline-delay control about 306 ms; delayed completion, streaming/full post-egress budget, pending-task drop, fresh outbound transport and old-scope revocation, 204 handoff, 500 fallback, and overlapping request gates all passed.The local workerd run exercises the actual Worker artifact. Hosted Cloudflare deployment was not exercised. Budgets are cooperative, and Workers independently limits the shared
waitUntillifetime; these checks do not establish durable completion. Panic isolation requires an unwinding build; an aborting WASM panic can terminate the invocation.Checklist
{id}syntax (not:id)edgezero_core(nothttpcrate)KvRegistry/ConfigRegistry/SecretRegistry(not the legacy single-handle setters) — existing store wiring is unchanged